package com.jason.java.demo.proxy;

import android.util.Log;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

/**
 * @description: MyInvokeHandler
 * @author: ChenBaoYang
 * @createDate: 2022/3/10 9:41 上午
 */
public class MyInvocationHandler implements InvocationHandler {

    private Object target;

    public MyInvocationHandler(Object target) {
        this.target = target;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        Log.i("chenby", "invocation before.");
        Object o = method.invoke(target, args);
        Log.i("chenby", "invocation after.");
        return o;
    }
}
